<div ng-init="dvm.init()">
  <form name="categoryForm" class="form-check" ng-submit="dvm.save(categoryForm.$valid)" novalidate>
    <div class="ngdialog-message">
      <h3>编辑物品分类</h3>
      <input type="hidden" ng-model="dvm.categoryId">
      <div class="form-group">
        <input name="categoryName" ng-model="dvm.categoryName" class="form-control" placeholder="物品分类名" autofocus required>
        <p class="alert alert-danger" ng-show="categoryForm.$submitted && categoryForm.categoryName.$error.required">
          <i class="glyphicon glyphicon-info-sign"></i> 物品分类名不能为空</p>
      </div>
      <div class="form-group">
        <select name="categoryParentId" ng-model="dvm.categoryParentId" class="form-control" ng-options="x.id as x.name for x in dvm.category"
            ng-disabled="dvm.categoryParentIdDisabled">
          <option value="">- 上级物品分类 -</option>
        </select>
        <p class="alert alert-danger" ng-show="categoryForm.$submitted && dvm.categoryParentIdRequired && dvm.categoryParentId == null">
          <i class="glyphicon glyphicon-info-sign"></i> 上级物品分类不能为空</p>
      </div>
    </div>
    <div class="ngdialog-buttons">
      <button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog()">取 消</button>
      <button type="submit" class="ngdialog-button ngdialog-button-primary">保 存</button>
    </div>
  </form>
</div>